package com.magic233.pipelinedeploymenttest.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: UserController
 * Description:
 * date: 2021/10/17 20:41
 * author: zouyuan
 */

@RestController
public class UserController {
    @Value("${sever.user.name}")
    private String name;

    private Integer cnt = 0;

    @RequestMapping("/hello")
    public Object hello() {
        cnt++;
        System.out.println("第" + cnt + "次访问");
        return "hello world！！！ " + "第" + cnt + "次访问";
    }

    @RequestMapping("getname")
    public Object getName() {
        System.out.println(name);
        return name;
    }
}
